package com.zr.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletResponseAware;
import org.springframework.stereotype.Controller;

import com.zr.service.CBBStationService;

import net.sf.json.JSONArray;
/*lxg
 * 加配送点的下拉框
 */
@Controller
public class CBBStationAction implements ServletResponseAware{
	private HttpServletResponse resp;
	@Override
	public void setServletResponse(HttpServletResponse arg0) {
		
		this.resp=arg0;
	}
	@Resource
	private CBBStationService cbbsseim;
	
	public void cbbStation(){
		resp.setCharacterEncoding("utf8");
		try {
			PrintWriter pw=resp.getWriter();
			JSONArray ja=cbbsseim.findStation();
			pw.write(ja.toString());
			pw.flush();
			pw.close();
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
